﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModulesPage.aspx.cs" Inherits="OA.Web.Authority.ModulesPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>功能模块管理</title>
    <link href="../Css/default.css" rel="stylesheet" type="text/css" />
    <link href="../themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../themes/icon.css" rel="stylesheet" type="text/css" />

    <script src="../Jscript/jquery-1.6.min.js" type="text/javascript"></script>

    <script src="../Jscript/jquery.easyui.min.js" type="text/javascript"></script>

    <style type="text/css">
        *
        {
            font-size: 13px;
            font-family: 微软雅黑;
        }
    </style>

    <script type="text/javascript">
        function change_child_win() {
            var childleftdiv = document.getElementById("childleftdiv");
            var contentPanel = document.getElementById("ContentPanel");
            contentPanel.style.height = window.frames["ContentPanel"].document.body.scrollHeight;
            childleftdiv.style.height = window.frames["ContentPanel"].document.body.scrollHeight;
        }

        window.onresize = function() {
            change_child_win();


        };
    </script>

    <script type="text/javascript">
        //2. 只打开一个节点,关闭其他兄弟节点(Just one expanded node, all other will collaps)

        function reinitIframe() {
            var iframe = document.getElementById("ContentPanel");

            try {

                iframe.height = iframe.contentWindow.document.documentElement.scrollHeight;

            } catch (ex) { }

        }

        window.setInterval("reinitIframe()", 200);

        function TreeView_ToggleNode(data, index, node, lineType, children) {
            var img = node.childNodes[0];
            var newExpandState;
            try {
                //***折叠兄弟节点(Collapse Brothers)-----
                CollapseBrothers(data, children);
                //---------------------------------------

                if (children.style.display == "none") {
                    children.style.display = "block";
                    newExpandState = "e";
                    if ((typeof (img) != "undefined") && (img != null)) {
                        if (lineType == "l") {
                            img.src = data.images[15];
                        }
                        else if (lineType == "t") {
                            img.src = data.images[12];
                        }
                        else if (lineType == "-") {
                            img.src = data.images[18];
                        }
                        else {
                            img.src = data.images[5];
                        }
                        img.alt = data.collapseToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                    }
                }
                else {
                    children.style.display = "none";
                    newExpandState = "c";
                    if ((typeof (img) != "undefined") && (img != null)) {
                        if (lineType == "l") {
                            img.src = data.images[14];
                        }
                        else if (lineType == "t") {
                            img.src = data.images[11];
                        }
                        else if (lineType == "-") {
                            img.src = data.images[17];
                        }
                        else {
                            img.src = data.images[4];
                        }
                        img.alt = data.expandToolTip.replace(/\{0\}/, TreeView_GetNodeText(node));
                    }
                }
                change_child_win();
            }
            catch (e) { }
            data.expandState.value = data.expandState.value.substring(0, index) + newExpandState + data.expandState.value.slice(index + 1);
        }

        //折叠兄弟节点(Collapse Brothers)
        function CollapseBrothers(data, childContainer) {
            var parent = childContainer.parentNode;
            for (i = 0; i < parent.childNodes.length; i++) {
                if (parent.childNodes[i].tagName.toLowerCase() == "div") {
                    if (parent.childNodes[i].id != childContainer.id) {
                        parent.childNodes[i].style.display = "none";
                    }
                }
                else if (parent.childNodes[i].tagName.toLowerCase() == "table") {
                    var treeLinks = parent.childNodes[i].getElementsByTagName("a");
                    var j = 0;
                    if (treeLinks[j].firstChild.tagName) {
                        if (treeLinks[j].firstChild.tagName.toLowerCase() == "img") {
                            var img = treeLinks[j].firstChild;
                            img.src = data.images[4];
                        }
                    }
                }
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="childleftdiv" style="float: left; height: auto !important; height: 450px;
        min-height: 450px; border-right: 1px #9f9d9f solid;">
        <table width="20%" border="0" cellpadding="3" cellspacing="1">
            <tr>
                <td class="titlePadding">
                    &nbsp;模块列表
                </td>
            </tr>
            <tr>
                <td style="padding: 5px 10px 5px 10px;">
                    <asp:TreeView ID="Treeview1" runat="server" ImageSet="XPFileExplorer" AutoGenerateDataBindings="False"
                        ExpandDepth="0" NodeIndent="15">
                        <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
                            VerticalPadding="0px"></SelectedNodeStyle>
                        <Nodes>
                            <asp:TreeNode Expanded="True" NavigateUrl="ModulesInfoPage.aspx?id=0&type=2" Target="ContentPanel"
                                Text="模块管理" Value="0,0"></asp:TreeNode>
                        </Nodes>
                        <NodeStyle VerticalPadding="2px" Font-Names="Tahoma" Font-Size="8pt" HorizontalPadding="2px"
                            ForeColor="Black" NodeSpacing="0px"></NodeStyle>
                        <ParentNodeStyle Font-Bold="False" />
                        <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA"></HoverNodeStyle>
                    </asp:TreeView>
                </td>
            </tr>
        </table>
    </div>
    <div id="childrightdiv" style="float: left; width: 79%; height: 100%">
        <iframe id="ContentPanel" name="ContentPanel" width="100%" height="100%" frameborder="0"
            scrolling="no" src="ModulesInfoPage.aspx"></iframe>
    </div>
    >
    </form>
</body>
</html>
